<require>prefetch $</require>

<template id="bodyTpl">
    <input type="text" value="https://eustia.liriliri.io/"/>
    <button>Fetch</button>
</template>

<script>
$('body').html(bodyTpl);

$('button').on('click', function () 
{
    prefetch($('input').val()).then(() => {
        console.log('success');
    }).catch(() => {
        console.log('error');
    });
});
</script>